/**
 * 匠言知识付费v2.0.0
 * Author: 山西匠言网络科技有限公司
 * 这不是一个免费软件，它受限于许可条款，你可以访问https://www.zsfzxkc.cn/获取更多详细信息。
 * This is not a free software, it under the license terms, you can visit https://www.zsffzxkc.cn/ get more details.
 */
<template>
	<view class="container">
		<jy-quick-btns></jy-quick-btns>
		<!-- 自定义底部start -->
		<jy-navbar :current_index='current_ind'></jy-navbar>
		<!-- 自定义底部end -->
		<!-- 联系我们微信二维码、电话 -->
		<view class="contact" v-if="wechatshow">
			<image :src="base_set.wechat" mode="aspectFit"></image>
			<view @click="make_phone1"><text>电话：{{base_set.phone}}</text><button type="primary" size="mini">一键拨号</button></view>
			<image class="closebtn" src="../../static/close.png" mode="aspectFit" @click="closewechat"></image>
		</view>
		<view class="message">
			<!-- 系统消息 -->
			<view class="message-list" @click="navigate('message-details','sys')" v-if="base_set.smallapp.is_sh == 0">
				<view class="item-left">
					<image src="../../static/laba.png" mode="aspectFit"></image>
					<view class="item-left-right">
						<text>系统消息</text>
						<text>系统通知、广播</text>
					</view>
				</view>
				<view class="item-right">
					<image src="../../static/xiangyou11.png" mode="aspectFit"></image>
				</view>
			</view>
			<!-- 我的通知 -->
			<view class="message-list" @click="navigate('message-details','my')">
				<view class="item-left">
					
						<image src="../../static/tongzhi.png" mode="aspectFit"></image>
					
					<view class="item-left-right">
						<text>我的通知</text>
						<text>订单进度，直播通知，活动通知等</text>
					</view>
				</view>
				<view class="item-right">
					<image src="../../static/xiangyou11.png" mode="aspectFit"></image>
				</view>
			</view>
			<!-- 聊天列表 -->
			<view class="message-list" @click="navigate('chat-list','')">
				<view class="item-left">
					<uni-badge :text="dot_text" type='error' size="small" absolute="rightTop">
						<image src="../../static/zaixiankefu.png" mode="aspectFit"></image>
					</uni-badge>
					<view class="item-left-right">
						<text>聊天列表</text>
						<text>商家聊天会话列表</text>
					</view>
				</view>
				<view class="item-right">
					<image src="../../static/xiangyou11.png" mode="aspectFit"></image>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				base_set:[],
				wechatshow:false,
				current_ind:3,
				dot_text:0,
				my_msgList:[],
				has_notReadMsg:true
			};
		},
		onLoad() {
			// #ifdef MP-TOUTIAO
			this.footerList[1].page_route = '/pages/sign-in/sign-in';
			this.footerList[1].name = '签到';
			// #endif
			this.getsetting()
		},
		onShow() {
			this.dot_text = getApp().globalData.dot_text;
			this.my_msgList = getApp().globalData.new_msgList;
		},
		methods: {
			getsetting(){
				let base_set =this.base_set= uni.getStorageSync('base_set')
				this.shop_phone=base_set.phone
			},
			closewechat(){
				this.wechatshow=false
			},
			make_phone(){
				this.wechatshow=true
			},
			make_phone1(){
				if(this.shop_phone!=''){
					uni.makePhoneCall({
						phoneNumber: this.shop_phone
					});
				}else{
					uni.showToast({
						title:'暂未设置客服联系方式！',
						icon:'none'
					})
				}
			},
			navigate(e,type) {
				if(e=='chat-list'){
					var userinfo = uni.getStorageSync('userinfo')
					var data = {
						id: userinfo.uid,
						realname: userinfo.userdata.nickname,
						doctor_img: userinfo.userdata.avatar,
					};
					uni.navigateTo({
						url: `/pages/wenda/${e}/${e}?item=${JSON.stringify(data)}`
					});
					
				}else{
					uni.navigateTo({
						url: `/pages/${e}/${e}?type=${type}`
					});
				}
			}
		}
	}
</script>

<style lang="less" scoped>
	.contact{
		background: rgba(9,9,9,.6);
		position: fixed;
		height: 100vh;
		width: 100%;
		top:0;
		left:0;
		z-index: 999999;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		view{
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: center;
			height: 80upx;
			margin-top: 30upx;
			text{
				color: #fff;
				margin-right: 20upx;
			}
		}
		.closebtn{
			width: 40upx;
			height: 40upx;
			margin-top: 50upx;
		}
		image{
			width: 60%;
		}
	}
.message {
	&-list {
		padding: 40upx 30upx;
		background-color: #fff;
		border-bottom: 4upx solid #f5f5f5;
		display: flex;
		align-items: center;
		justify-content: space-between;
		.item-left {
			display: flex;
			align-items: center;
			image {
				width: 90upx;
				height: 90upx;
				border-radius: 50%;
			}
			&-right {
				margin-left: 40upx;
				display: flex;
				flex-direction: column;
				align-items: flex-start;
				button{
					border: none;
					padding: 0;
					margin: 0;
					outline: none;
					background-color: transparent;
					font-size: 34upx;
					font-weight: 700;
					color: #333;
				}
				button::after{
					border: none;
					padding: 0;
					margin: 0;
				}
				text:nth-child(1) {
					font-size: 34upx;
					font-weight: 700;
					color: #333;
					margin-bottom: 8upx;
				}
				text:last-child {
					font-size: 28upx;
					color: #999;
				}
			}
		}
		.item-right {
			image {
				width: 14upx;
				height: 24upx;
			}
			text {
				font-size: 30upx;
				color: #999;
			}
		}
		
	}
}

</style>
